home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk UserVolume 4 #7 / Commodore_Disk_User_Vol.4_7_1991_-.d64 / basic slider (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  78 lines

  1. 0 rem "basic slider" (c) dread 1991
  2. 7 a=a+1:if a=1 then load "chars.mc",8,1
  3. 9 poke 53280,14:poke 53281,6:poke 53272,24
  4. 10 print "[147]";
  5. 15 a$="   [194][193][211][201][195] [211]lider [196]emonstration program   ":gosub 10000
  6. 20 a$="            ([195])[160][196]read 1991              ":gosub 10000
  7. 25 a$="----------------------------------------":gosub 10000
  8. 30 for a=0 to 1500:next
  9. 35 print "[147]";
  10. 40 a$="[212]his very simple text-sliding technique ":gosub 10000
  11. 45 a$="uses two key [194][193][211][201][195] commands:            ":gosub 10000
  12. 50 a$="                                        ":gosub 10000
  13. 55 a$=" [210][201][199][200][212]$ and [204][197][206](a$).                    ":gosub 10000
  14. 57 a$="[160]                                       ":gosub 10000
  15. 60 a$="[200]ow they are used in the subroutine will":gosub 10000
  16. 65 a$="be explained later, as will how to put  ":gosub 10000
  17. 70 a$="the subroutine into your own programs.  ":gosub 10000
  18. 75 rem **** wait for keypress ****
  19. 77 print ""
  20. 80 poke 198,0
  21. 85 a$="             [208]ress any key              ":gosub 10000
  22. 87 print "[145][145][145][145][145]"
  23. 90 a$="[160]                                       ":gosub 10000
  24. 95 if peek(198)=0 then 80
  25. 100 print "[147]"
  26. 105 a$="          [200]ow the [211]lider works          ":gosub 10000
  27. 107 print "[145][145]"
  28. 110 a$="          [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]          ":gosub 10000
  29. 115 a$=" [212]he subroutine.                        ":gosub 10000
  30. 120 print " 10000 [198][207][210][160]a=[204][197][206](a$) [212][207][160]0 [211][212][197][208][160]-1"
  31. 125 print " 10005 [208][210][201][206][212] [210][201][199][200][212]$(a$,[204][197][206](a$)-a);";chr$(34);"";chr$(34)
  32. 130 print "[160]10010 [206][197][216][212]"
  33. 135 print "[160]10020 [210][197][212][213][210][206]                           "
  34. 140 a$="[201]f required, a pause can be set between ":gosub 10000
  35. 145 a$="lines 10005 and 10010, using the line:  ":gosub 10000
  36. 150 print " 10007 [198][207][210] x=0 [212][207] (delay):[206][197][216][212]"
  37. 155 for a=0 to 3350:next a
  38. 160 print "[147]"
  39. 165 a$="[206]ow you can try the sliding technique   ":gosub 10000
  40. 170 a$="out for yourself! ([205]ake sure that the   ":gosub 10000
  41. 175 a$="text you want to slide is 40 characters ":gosub 10000
  42. 180 a$="long, or it will not work properly.)    ":gosub 10000
  43. 185 input " [217]our text";t$
  44. 190 if len(t$)<40 or len(t$)>40 then print "[212]his will not work!":goto 185
  45. 195 a$=t$:print "[147]":gosub 10000
  46. 200 input "[193]nother go";g$:if g$<>"y" or g$<>"yes" then 210
  47. 205 goto 185
  48. 210 print "[147]";
  49. 215 a$="[200]ere is the program that slided that    ":gosub 10000
  50. 220 a$="last piece of text....                  ":gosub 10000
  51. 225 print " 10 a$=";chr$(34);t$;chr$(34)":gosub 10000"
  52. 230 print "[160]10000 [198][207][210] a=[204][197][206](a$) [212][207] 0 [211][212][197][208] -1"
  53. 235 print " 10005 [208][210][201][206][212] [210][201][199][200][212]$(a$,[204][197][206](a$)-a);";chr$(34);"";chr$(34)
  54. 240 print "[160]10010 [206][197][216][212]"
  55. 245 print " 10015 [210][197][212][213][210][206][160]                          "
  56. 250 a$=" [206]ow you should now everything there is ":gosub 10000
  57. 255 a$="to know about the [194]asic [211]lider, and can ":gosub 10000
  58. 260 a$="use the subroutine in your own programs.":gosub 10000
  59. 265 for a=0 to 3650:next
  60. 270 print "[147]";:poke 53272,23:poke 53280,4:poke 53281,0:poke 650,128
  61. 275 print " <[198]1> - load [211]lider subroutine."
  62. 280 print " <[198]3>[160]- restart [196]emonstration."
  63. 285 print " <[198]5>[160]- [209]uit and return to [194][193][211][201][195] [214]2"
  64. 290 get a$:if a$="" then 290
  65. 295 if asc(a$)<133 and asc(a$)>135 then goto 290
  66. 300 if a$=chr$(133) then load "slider.sub",8
  67. 305 if a$=chr$(134) then goto 9
  68. 310 if a$=chr$(135) then sys 64738
  69. 9999 end
  70. 10000 for a=len(a$) to 0 step -1
  71. 10005 print right$(a$,len(a$)-a);"[145]"
  72. 10010 next
  73. 10015 for x=0 to 264:next x
  74. 10020 return
  75. 10025 rem -------------------------
  76. 10030 rem lines 10000-10015 are the
  77. 10035 rem slider subroutine ^ ^ ^ ^
  78.